package com.jeesite.modules.kj.api.vo.response;

import com.jeesite.common.collect.ListUtils;
import com.jeesite.modules.kj.api.vo.responseVo.base.BaseResponseVo;
import com.jeesite.modules.kj.entity.KjBadge;
import com.jeesite.modules.kj.entity.KjBadgeType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.List;

@Data
public class BadgeTypeResponseVo extends BaseResponseVo<KjBadgeType> {
    @ApiModelProperty(value = "徽章类型ID")
    private String id;
    @ApiModelProperty(value = "徽章名")
    private String typeName;
    @ApiModelProperty(value = "徽章图")
    private List<BadgeResponseVo> badgeList;


    public BadgeTypeResponseVo() {
    }

    @Override
    public void setEntity(KjBadgeType entity) {
        BeanUtils.copyProperties(entity, this);
    }

    public BadgeTypeResponseVo(KjBadgeType entity) {
        setEntity(entity);
    }


    public List<BadgeResponseVo> getBadgeList() {
        return badgeList;
    }

    public void setBadgeList(List<KjBadge> badgeList) {
        this.badgeList = ListUtils.newArrayList();
        for (KjBadge badge: badgeList
             ) {
            this.badgeList.add(new BadgeResponseVo(badge));
        }
    }
}
